]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Fix dead error handling
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Aug 2021 01:02:05 +0000 (03:02 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Aug 2021 13:16:54 +0000 (15:16 +0200)
gjs includes an override to turn GSettings' asserts into exceptions,
but we'll have to catch that instead of checking for a null return
value.

Spotted by coverity in CID 351268.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1950>

js/ui/appDisplay.js

index 012e88bd0b9bd921bc7cb7627e5a03d8ba69f839..3673c8541633d107917cd17d1d676ea205420c97 100644 (file)
@@ -1831,11 +1831,13 @@ class AppDisplay extends BaseAppView {
 
         // Create the new folder
         let newFolderPath = this._folderSettings.path.concat('folders/', newFolderId, '/');
-        let newFolderSettings = new Gio.Settings({
-            schema_id: 'org.gnome.desktop.app-folders.folder',
-            path: newFolderPath,
-        });
-        if (!newFolderSettings) {
+        let newFolderSettings;
+        try {
+            newFolderSettings = new Gio.Settings({
+                schema_id: 'org.gnome.desktop.app-folders.folder',
+                path: newFolderPath,
+            });
+        } catch (e) {
             log('Error creating new folder');
             return false;
         }